class Solution {
public:
    int maxBottlesDrunk(int numBottles, int numExchange) {
        int ret = numBottles, b = numBottles;
        while (b >= numExchange) {
            b -= numExchange;
            ret++;
            b++;
            numExchange++;
        }
        return ret;
    }
};